<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>27comonentprops</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <script type="text/javascript" src="../assets/js/vue.js"></script>
</head>

<body>
    <h1>27comonent 的props</h1>
    <a href="../index.html">返回</a>
    <hr />
    <div id="app">

        <panda here="China"></panda>
        <cat lyy-name="Tom"></cat>
        <notice :notice="message"></notice>
        <notice v-bind:notice="message"></notice>
    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: "#app",
            data: {
                message: "最新公告:xxx"
            },
            components: {
                "panda": {
                    template: `<div style="color:red">Panda from {{here}}</div>`,
                    props: ['here']
                },
                "cat": {
                    template: `<div>This cat name is {{lyyName}}</div>`,
                    props: ['lyyName']
                },
                "notice": {
                    template: `<div>{{notice}}</div>`,
                    props: ['notice']
                }
            }
        })
    </script>
</body>

</html>